package com.time.social.enums;

import lombok.Getter;

/**
 * 社交平台类型枚举
 *
 * @author: HuangQi
 * @date: Created in 2025/01/XX
 * @description: 社交平台类型枚举
 */
@Getter
public enum SocialTypeEnum {

    WX("WX", "微信"),
    GITHUB("GITHUB", "GitHub"),
    QQ("QQ", "QQ");

    private final String code;
    private final String desc;

    SocialTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SocialTypeEnum getByCode(String code) {
        for (SocialTypeEnum type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
}

